<!DOCTYPE html>
<html lang="en">
    <head><meta charset="UTF-8"><title>分类列表</title></head>
    <body><form action="/Admin.cate/bysort" method="post">
        <table class="table table-bordered table-striped table-hover table-condensed">
            <thead><tr>
            <th width="2%">cid</th><th width="15%">分类名</th>
            <th width="20%">关键词</th><th width="25%">描述</th><th width="37%">操作</th>
            <th width="1%">排序</th></tr> 
        </thead>
        <?php foreach($data as $key => $v) { ?><tr><td><?php echo $v['id'];?></td>
            
            <td style="text-indent:<?php echo $v['level']*20; ?>px;"><?php $prefixstr=$v["level"]==0?'':'|'; echo $prefixstr.str_repeat("_",$v["level"]*2).$v['name']; ?></td><td><?php echo $v['keywords']?></td><td><?php echo $v['description']?></td>
            <td> <a href="/admin.cate/add?cid=<?php echo $v['id']; ?>">添加子分类</a> | <a href="/admin.cate/edit?cid=<?php echo $v['id'] ?>">修改</a> | <a  href="javascript:if(confirm('确定要删除吗?')) location='/admin.cate/delete?cid=<?php echo $v["id"];?>';" >删除</a>
            </td>
            <td> <input class="form-control" type="text" name="<?php echo $v['id'] ?>" value="<?php echo $v['sort'] ?>"></td>
        </tr>
       <?php }?>
        <tr><td></td><td></td><td></td><td></td><td></td>
            <td> <input class="btn btn-success" type="submit" value="排序"></td>
        </tr>
        </table></form>
     
    </body>
    </html>